import request from '../utils/request'
import type { CheckIn } from '../types/checkIn'

export const checkInApi = {
  // 签到
  checkIn(data: { userId: number; eventId: number; qrCode: string }) {
    return request.post<CheckIn>('/check-ins', data)
  },

  // 获取签到详情
  getCheckIn(id: number) {
    return request.get<CheckIn>(`/check-ins/${id}`)
  },

  // 获取用户的签到记录
  getUserCheckIns(userId: number) {
    return request.get<CheckIn[]>(`/check-ins/user/${userId}`)
  },

  // 获取活动的签到记录
  getEventCheckIns(eventId: number) {
    return request.get<CheckIn[]>(`/check-ins/event/${eventId}`)
  }
} 